<?php

namespace app\tours\controller;

class Company extends Common {

    //关于我们
    public function about() {

        $id = I("get.id");
        $model = M("Aboutus");
        $condition = array();
        $condition['id'] = $id;
        $aboutus = $model->field(true)->where($condition)->cache()->find();
        if (empty($aboutus)) {
            $this->_empty();
        }
        $this->assign('aboutus', $aboutus);
        return $this->fetch("about");
    }

    //支付中心
    public function zhifu() {
        $payCon = array();
        $model = M("Pay");
        $condition = array();
        $condition['status'] = 0;
        $pay = $model->field(true)->where($condition)->order("id asc")->cache()->select();
        $aboutus['id'] = 0;
        $this->assign('aboutus', $aboutus);
        //取出银行
        foreach ($pay as $key => $val) {
            $payCate = M("PayCate")->field(true)->where(array('id' => $val['cid'], 'status' => 0))->cache()->find();
            $payCon[$key] = $val;
            $payCon[$key]['payname'] = $payCate['name'];
            $payCon[$key]['logo'] = $payCate['logo'];
            $payCon[$key]['bankurl'] = $payCate['bankurl'];
        }
        $this->assign('paycon', $payCon);
        return $this->fetch("zhifu");
    }

}
